package com.example.dao;

import com.example.entity.GoodsinfosInfo;
import com.example.vo.GoodsinfosInfoVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

@Repository
public interface GoodsinfosInfoDao extends Mapper<GoodsinfosInfo> {
    List<GoodsinfosInfoVo> findByGoodsnumbers(@Param("goodsnumbers") String goodsnumbers);
	
	//xiugaimimazy
    int checkRepeat(@Param("column") String column, @Param("value") String value, @Param("id") Long id);
    
    Integer count();
	
	@Select("select * from goodsinfos_info where goodsnumbers = #{goodsnumbers}")
    GoodsinfosInfo selectByGoodsnumbers(String goodsnumbers);
	
	@Select("SELECT * FROM goodsinfos_info order by id")
    List<Map<String, Object>> daochuexcel();
	
	@Select("SELECT xxdiquziduanxxxx,count(id) as hsggs FROM goodsinfos_info  group by xxdiquziduanxxxx")
    List<Map<String,String>> findByDiqu();
	
	
	
	@Select("SELECT distinct(types) as aa,count(id) as bb FROM goodsinfos_info group by types order by id")
List<Map<String, Object>> goodsinfos_tj_types();

	
	@Select("select count(id) from goodsinfos_info where stocks <= 50 ")
    Integer tixing();

 @Select("select * from goodsinfos_info where types= #{type}")
    List<GoodsinfosInfoVo> findByType(String type);

    @Select("select * from goodsinfos_info where goodsnamec  like concat('%', #{text}, '%')")
    List<GoodsinfosInfo> searchGoods(String text);



    //wexixinxzhuaxnyoxng
	
	

}
